home *** CD-ROM | disk | FTP | other *** search
- Path: news.mel.aone.net.au!usenet
- From: clyde@hitech.com.au (Clyde Smith-Stubbs)
- Newsgroups: comp.lang.c
- Subject: Re: Problem with c code, please help!
- Date: Sat, 20 Jan 1996 11:54:47 GMT
- Organization: HI-TECH Software
- Message-ID: <3100d784.204286080@news.bne.aone.net.au>
- References: <surgsw-1901960148530001@128.206.206.86> <mikedorman-1901960725380001@205.148.200.150>
- Reply-To: clyde@hitech.com.au
- NNTP-Posting-Host: skyhawk.hitech.com.au
- X-Newsreader: Forte Agent .99c/16.141
-
- On Fri, 19 Jan 1996 07:25:37 -0600, mikedorman@cedarnet.com (Mike
- Dorman) wrote:
-
- >main()
- >{
- > char *word;
- >
- > puts("Enter a word: ");
- > while(scanf("%s", word) != 0)
- >
- > puts("You entered: ");
- > puts(word);
- >}
-
- Now woa Neddie! There's one major problem with this code - word is a
- pointer that points to nothing in particular. This code is guaranteed
- to randomly crash in a big way. Furthermore you've got a loop there
- that is certainly not what was intended. Please check your code before
- posting!
- ----
- Clyde Smith-Stubbs | HI-TECH Software, | Voice: +61 7 3300 5011
- clyde@hitech.com.au | P.O. Box 103, Alderley, | Fax: +61 7 3300 5246
- http://www.hitech.com.au | QLD, 4051, AUSTRALIA. | BBS: +61 7 3300 5235
- ----------------------------------------------------------------------------
- FREE! Download our shareware (FREE for noncommercial use) MS-DOS C Compiler!
- Point your Web browser at http://www.hitech.com.au/
-